<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>rotate</title>
    <style type="text/css">
    body{
        /* 透视，视距。 */
        perspective: 1000px;
    }
        .wrapper {
            width: 200px;
            height: 200px;
            border: 2px solid purple;
            margin: 150px auto;
            transition: transform 500ms;
        }
        
        .first:hover {
            transform: rotate(-45deg);
        }
        
        .second:hover {
            /* rotate 让元素在二维平面上可以沿 顺时针 或 逆时针 旋转 (我们是从Z轴正值方向看过去) */
            transform: rotate(45deg);
        }
        
        .third:hover {
            transform: rotateX(45deg);
        }
        
        .fourth:hover {
            transform: rotateY(45deg);
        }
    </style>
</head>
<body>
    <div class="wrapper first"></div>
    <div class="wrapper second"></div>
    <div class="wrapper third"></div>
    <div class="wrapper fourth"></div>
</body>
</html>